<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Class Site
 * @User wuqin
 * @Date 2018/3/13 0013
 * @Time 16:30
 */
class Site extends CI_Controller {
    /**
     * Site constructor.
     */
    function __construct()
    {
        parent::__construct();
        date_default_timezone_set('PRC');
        if(!isset($_SESSION)){
            session_start();
        }
    }

    /**
     * 方法 : login
     * @User wuqin
     * @DateTime 2018-03-13 16:30
     */
    public function login()
    {
        $_SESSION['admin_info'] = array(
            'state' => 1,
        );
        $this->load->view('/site/login');
    }
    /**
     * @author dzx
     * @date   2018-03-16
     */
    public function logout()
    {
        session_unset();
        session_destroy();
        $this->load->helper('cookie');
        delete_cookie("nologin");
        header("LOCATION: /site/login");
    }
}